import "reflect-metadata"
import dotenv from "dotenv"
import { AppDataSource } from "./src/config/database"
import app from "./src/app"

// 加载环境变量
dotenv.config()

process.env.TZ = 'Asia/Shanghai'; // 设置为北京时间

const PORT = process.env.PORT || 3000

AppDataSource.initialize()
    .then(() => {
        console.log("Data Source has been initialized!")
        
        app.listen(PORT, () => {
            console.log(`Server is running on port ${PORT}`)
        })
    })
    .catch((err) => {
        console.error("Error during Data Source initialization:", err)
    })

// ... 其他应用代码 ... 